﻿using EpubFactory.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EpubFactory.Lib99.Service
{
    public class PbtxtReceipe : Receipe
    {
        public override IEnumerable<Uri> SourceUriList
        {
            get { return new Uri[] { new Uri("http://www.pbtxt.com") }; }
        }

        public override string Name
        {
            get { return "pbtxt"; }
        }

        public override Book GetBook()
        {
            throw new NotImplementedException();
        }

        public override string ExtractBookId(string url)
        {
            var a = url.LastIndexOf('/');
            if (a != url.Length - 1)
            {
                return url.Substring(a + 1);
            }
            var b = url.Substring(0, a);
            var c = b.LastIndexOf('/');
            return b.Substring(c + 1);
        }
    }
}
